package com.zjitc;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import com.zjitc.config.JavaConfigDemo1;
import com.zjitc.config.JavaConfigDemo2;
import com.zjitc.obj.Teacher;
import com.zjitc.obj.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/6 15:57
 * @description:
 */
public class App3 {

  public static void main(String[] args) {
    ApplicationContext context = new AnnotationConfigApplicationContext(JavaConfigDemo2.class);
    User u1=context.getBean("user", User.class);
    User u2=context.getBean("user",User.class);
    if(!u1.equals(u2)){
      System.out.println("!equals");
    }
    Teacher t1=context.getBean("teacher",Teacher.class);
    Teacher t2=context.getBean("teacher",Teacher.class);
    if(!t1.equals(t2)){System.out.println("!eq");}
    System.out.println(u1);
    System.out.println(u2);
    System.out.println(t1);
  }

}
